Skip to content

Comments

Don't capture with ast_pattern and do ast directly#558

Merged
davesnx merged 4 commits intomainfrom
improve-error-messages-for-ppx
Aug 18, 2025
Merged

Don't capture with ast_pattern and do ast directly#558
davesnx merged 4 commits intomainfrom
improve-error-messages-for-ppx

Conversation

@davesnx
Copy link
Owner

@davesnx davesnx commented Aug 18, 2025

Fixes the error message for #557. By not using the Ppxlib.Ast_pattern way and allow any expression in the pattern, and latter pattern match the right AST. This might cause some future maintainance in the future, but it's worth to have proper education to errors.

  File "input.re", line 3, characters 23-25:
  3 | let invalid_css = [%cx []];
                             ^^
  Error: [%cx] expects either a string of CSS or an array of CSS rules. 
  
  Example:
    [%cx "display: block"]
    [%cx [|CSS.display(`block)|]]
  
  More info: https://styled-ppx.vercel.app/reference/cx
  [1]
  • Added the possibility to print examples by language (ocaml will print some ocaml syntax, etc)
  • Ensure Error has a proper interface, created mli and improved the current fns

@vercel
Copy link

vercel bot commented Aug 18, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
styled-ppx Ignored Ignored Preview Aug 18, 2025 2:16pm

@davesnx davesnx mentioned this pull request Aug 18, 2025
15 tasks
…ror-messages-for-ppx

* 'main' of github.com:/davesnx/styled-ppx:
  Ignore ∞ in the spec parser
@github-actions
Copy link

New nightly version has been published to the NPM registry: @davesnx/styled-ppx@0.56.1-574cd7c.0.
Install it with npm install @davesnx/styled-ppx@nightly or npm install @davesnx/styled-ppx@0.56.1-574cd7c.0.

@davesnx davesnx merged commit 4156733 into main Aug 18, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant